//
//  DiscussTableViewCell.m
//  Movie
//
//  Created by tengyang on 15/7/27.
//  Copyright (c) 2015年 tengyang. All rights reserved.
//

#import "DiscussTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "common.h"
#import "UIViewExt.h"
@implementation DiscussTableViewCell

- (void)awakeFromNib {
    // Initialization code
    _content.numberOfLines=0;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModal:(DiscussModal *)modal
{
    _modal=modal;
    [self setNeedsLayout];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    [_userImage sd_setImageWithURL:[NSURL URLWithString:_modal.userImage]];
    _nickname.text=_modal.nickname;
    _nickname.textColor=[UIColor orangeColor];
    _rating.left=340;
    _rating.text=_modal.rating;
    CGFloat maxLabelWidth=kWidth-100;
    
    CGSize contenSize = [_modal.content sizeWithFont:[UIFont systemFontOfSize:18] constrainedToSize:CGSizeMake(maxLabelWidth, 1000)];
    
    _content.frame=CGRectMake(70, 15,contenSize.width ,contenSize.height+20);
    
    _content.text=_modal.content;

    
    
}


@end
